<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">

<title>随便打TCS系统</title>

<!-- Bootstrap -->
<link href="<%=basePath%>vendors/bootstrap/dist/css/bootstrap.min.css"
	rel="stylesheet">
<!-- Font Awesome -->
<link
	href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"
	rel="stylesheet">
<!-- NProgress -->
<link href="<%=basePath%>vendors/nprogress/nprogress.css"
	rel="stylesheet">
<!-- iCheck -->
<link href="<%=basePath%>vendors/iCheck/skins/flat/green.css"
	rel="stylesheet">

<!-- bootstrap-progressbar -->
<link
	href="<%=basePath%>vendors/bootstrap-progressbar/css/bootstrap-progressbar-3.3.4.min.css"
	rel="stylesheet">
<!-- JQVMap -->
<link href="<%=basePath%>vendors/jqvmap/dist/jqvmap.min.css"
	rel="stylesheet" />
<!-- bootstrap-daterangepicker -->
<link
	href="<%=basePath%>vendors/bootstrap-daterangepicker/daterangepicker.css"
	rel="stylesheet">

<!-- Custom Theme Style -->
<link href="<%=basePath%>build/css/custom.min.css" rel="stylesheet">

</head>
<body class="nav-md">
	<%@ include file="loginCheck.jsp"%>
	<div class="container body">
		<div class="main_container">
			<div class="col-md-3 left_col">
				<div class="left_col scroll-view">
					<div class="clearfix"></div>
					<br />
				</div>
			</div>
			<!-- page content -->
			<div class="right_col" role="main">
				<div class="">
					<div class="clearfix"></div>
					<div class="row">
						<div class="col-md-12 col-sm-12 col-xs-12">
							<div class="x_panel">
								<div class="x_content">
									<c:if test="${type == 1}"><span class="section">一级(一店)配置</span></c:if>
									<c:if test="${type == 2}"><span class="section">二级(二店)配置</span></c:if>
									<c:if test="${type == 3}"><span class="section">三级(三店)配置</span></c:if>
									<form name="myForm" class="form-horizontal form-label-left"
										novalidate method="post" enctype="multipart/form-data"
										id="myForm">
										<div class="item form-group" style="display: none">
											<label class="control-label col-md-3 col-sm-3 col-xs-12"
												for="name">id<span class="required"></span>
											</label>
											<div class="col-md-6 col-sm-6 col-xs-12">
												<input id="id" name="id"
													class="form-control col-md-7 col-xs-12" type="text"
													value="${usersRebate.id}">
											</div>
										</div>
										<c:if test="${type == 1}">
											<div class="form-group" id="personal1">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">一星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio1" name="reratio1"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio1}">
												</div>
											</div>
											<div class="form-group" id="personal2">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">二星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio2" name="reratio2"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio2}">
												</div>
											</div>
											<div class="form-group" id="personal3">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">三星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio3" name="reratio3"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio3}">
												</div>
											</div>
										</c:if>
										<c:if test="${type == 1 || type == 2}">
											<div class="form-group" id="personal4">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">四星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio4" name="reratio4"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio4}">
												</div>
											</div>
											<div class="form-group" id="personal5">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">五星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio5" name="reratio5"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio5}">
												</div>
											</div>
											<div class="form-group" id="personal6">
												<label class="control-label col-md-3 col-sm-3 col-xs-12"
													   for="name">六星金额 <span class="required">*</span>
												</label>
												<div class="col-md-6 col-sm-6 col-xs-12">
													<input id="reratio6" name="reratio6"
														   class="form-control col-md-7 col-xs-12" type="text"
														   placeholder="例如：0.05（0.05等于5%）" value="${usersRebate.reratio6}">
												</div>
											</div>
										</c:if>
										<div class="item form-group">
											<label class="control-label col-md-3 col-sm-3 col-xs-12"
												for="name">七星金额 <span class="required">*</span>
											</label>
											<div class="col-md-6 col-sm-6 col-xs-12">
												<input id="reratio7" class="form-control col-md-7 col-xs-12"
													data-validate-length-range="6" data-validate-words="2"
													name="reratio7" placeholder="例如：0.05（0.05等于5%）"
													required="required" type="text" value="${usersRebate.reratio7}">
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-3 col-sm-3 col-xs-12"
												for="name">八星金额 <span class="required">*</span>
											</label>
											<div class="col-md-6 col-sm-6 col-xs-12">
												<input id="reratio8" class="form-control col-md-7 col-xs-12"
													data-validate-length-range="6" data-validate-words="2"
													name="reratio8" placeholder="例如：0.05（0.05等于5%）"
													required="required" type="text" value="${usersRebate.reratio8}">
											</div>
										</div>
										<div class="item form-group">
											<label class="control-label col-md-3 col-sm-3 col-xs-12"
												for="name">九星金额 <span class="required">*</span>
											</label>
											<div class="col-md-6 col-sm-6 col-xs-12">
												<input id="reratio9" class="form-control col-md-7 col-xs-12"
													data-validate-length-range="6" data-validate-words="2"
													name="reratio9" placeholder="例如：0.05（0.05等于5%）"
													required="required" type="text" value="${usersRebate.reratio9}">
											</div>
										</div>
										<div class="form-group">
											<div class="col-md-6 col-md-offset-3">
												<input id="revise" type="button" class="btn btn-success"
													value="确定">
											</div>
										</div>
									</form>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<!-- /page content -->
		</div>
	</div>
	<!-- /page content -->
	<!-- 上传图片并修改 -->
	<script src="<%=basePath%>vendors/jquery/dist/jquery.min.js"></script>
	<script type="text/javascript">
		$('#revise').click(function() {
			$.ajax({
				type : 'POST',
				url : 'usersrebate_do_update',
				data : $('#myForm').serialize(),
				dataType : 'json',
				success : function(date) {
					switch (date) {
					case -1:
						alert("登录超时，请重新登录");
						top.location.href = "login/${titleId}";
						break;
					case 1:
						alert("修改成功");
						location.href = "usersrebate_index?type=" + ${type};
						break;
					default:
						alert("修改失败，请重新操作");
						break;
					}
				},
				error : function() {
					alert("修改失败，请重新操作");
			    }
			});					
		});
	</script>
	<!-- Bootstrap -->
	<script src="<%=basePath%>vendors/bootstrap/dist/js/bootstrap.min.js"></script>
	<!-- FastClick -->
	<script src="<%=basePath%>vendors/fastclick/lib/fastclick.js"></script>
	<!-- NProgress -->
	<script src="<%=basePath%>vendors/nprogress/nprogress.js"></script>
	<!-- bootstrap-daterangepicker -->
	<script src="<%=basePath%>vendors/moment/min/moment.min.js"></script>
	<script
		src="<%=basePath%>vendors/bootstrap-daterangepicker/daterangepicker.js"></script>
	<!-- Chart.js -->
	<script src="<%=basePath%>vendors/Chart.js/dist/Chart.min.js"></script>

	<!-- Custom Theme Scripts -->
	<script src="<%=basePath%>build/js/custom.min.js"></script>
</body>
</html>